import { MountStartsTargetToolTipsData } from "../../mounts/mountStarts/MountStartsTargetToolTipsData";
import { MountStartsSingleTarget } from "../../mounts/mountStarts/MountStartsSingleTarget";
import { ObjCreate } from "../ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
import { EColor } from "../../../../../Message/Public/EColor";
import { ItemData } from "../../../resource/info/ItemData";
import { ScaleBitmap } from "../../../../../com/mui/display/ScaleBitmap";
type int = number;
//class MountStartsTargetToolTip
    
    export  class MountStartsTargetToolTip /* flash.display.Sprite */
    {
        constructor(arg1: MountStartsTargetToolTipsData=null)
        {
            
            this.initView();
            return;
        }

        public /* override */ get height(): number
        {
            var loc1=NaN;
            if (this._isHide) 
            {
                loc1 = this._firstTarget.height + 6;
            }
            else 
            {
                loc1 = this._secondTarget.y + this._secondTarget.height + 3;
            }
            return loc1;
        }

        /* internal  */initView(): void
        {
            this._firstTarget = new MountStartsSingleTarget();
            addChild(this._firstTarget);
            this._line = ObjCreate.createBg(0, this._firstTarget.height + 5, 150, 3, this, ImagesConst.Line);
            this._secondTarget = new MountStartsSingleTarget();
            this._secondTarget.y = this._firstTarget.height + 8;
            addChild(this._secondTarget);
            return;
        }

        public set data(arg1: MountStartsTargetToolTipsData)
        {
            this.init(arg1);
            return;
        }

        /* internal  */init(arg1: MountStartsTargetToolTipsData): void
        {
            this._mountIdata = arg1.mountIData;
            if (!this._mountIdata) 
            {
                return;
            }
            this._curTarget = this._mountIdata.itemExInfo.m_stTa[arg1.curStartsLv];
            if (this._curTarget < EColor._EColorBlue) 
            {
                this._firstTarget.setData(this._mountIdata, arg1.curStartsLv, true, false);
                this.hideSecondPart(true);
            }
            else if (this._curTarget >= EColor._EColorRed) 
            {
                this._firstTarget.setData(this._mountIdata, arg1.curStartsLv, true, true);
                this.hideSecondPart(true);
            }
            else 
            {
                this._firstTarget.setData(this._mountIdata, arg1.curStartsLv, true, true);
                this._secondTarget.setData(this._mountIdata, arg1.curStartsLv, false, false);
                this.hideSecondPart(false);
            }
            return;
        }

        /* internal  */hideSecondPart(arg1: Boolean): void
        {
            this._isHide = arg1;
            this._line.y = this._firstTarget.height + 5;
            this._secondTarget.y = this._firstTarget.height + 8;
            if (arg1) 
            {
                this._line.visible = false;
                this._secondTarget.visible = false;
            }
            else 
            {
                this._line.visible = true;
                this._secondTarget.visible = true;
            }
            return;
        }

        /* internal */ /* var */_mountIdata: ItemData;

        /* internal */ /* var */_isDoubleShow: Boolean;

        /* internal */ /* var */_firstTarget: MountStartsSingleTarget;

        /* internal */ /* var */_secondTarget: MountStartsSingleTarget;

        /* internal */ /* var */_line: ScaleBitmap;

        /* internal */ /* var */_curTarget: int;

        /* internal */ /* var */_isHide: Boolean;
    }
